﻿<?php
    require_once('Zend/Currency.php');
    $currency = new Zend_Currency('cs_CZ');
?>
<h2><?= $this->translate("Shopping Basket") ?></h2>
<form action="<?= $this->url(array('controller' => 'user-basket', 'action' => 'update-basket-items')) ?>" method="post">
    <table cellpadding="0" cellspacing="0">
        <tr>
            <th><?= $this->translate("Product Name") ?>:</th>
            <th><?= $this->translate("Amount") ?>:</th>
            <th><?= $this->translate("Price Per Item") ?>:</th>
            <th><?= $this->translate("Total Price") ?>:</th>
        </tr>
    <?php foreach( $this->basketItems as $item ) { ?>
    	<tr>
    		<td><?= $item->Product->translate("name") ?></td>
    		<td><input type="text" name="amount_<?= $item->Product->id ?>" value="<?= $item->amount ?>" size="2" /></td>
    		<td><?= $currency->toCurrency($item->Product->price) ?></td>
    		<td><?= $currency->toCurrency($item->price) ?></td>		
    	</tr>
    <?php } ?>
        <tr class="bg">
            <td colspan="4"><?= $this->translate("Total Price") ?>: <span id="totalPrice"><?= $currency->toCurrency($this->totalPrice) ?></span></td>
        </tr>
    </table>
    <div>
        <input type="submit" value="<?= $this->translate("Update") ?>" />
    </div>
</form>
<?php if (count($this->basketItems)>0) { ?>
<div id="left">
<div id="submitbutton">
	<a href="<?= $this->url(array('controller' => 'orders', 'action' => 'order-overview')) ?>" title="<?= $this->translate("Order") ?>"><?= $this->translate("Order") ?></a>
</div>
</div>
<?php } ?>